package com.blockchain.front.servlets.security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.framework.resource.PromptLevel;
import com.blockchain.framework.service.ServiceSession;
import com.blockchain.front.service.security.SecurityManage;

public class UpdateLogin extends AbstractSceurityServlet {

	private static final long serialVersionUID = 1L;
	@Override
	protected void processPost(HttpServletRequest request,
			HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		String oldpassword=request.getParameter("oldpassword");
		String newpassword=request.getParameter("newpassword");
		String repassword=request.getParameter("repassword");
		SecurityManage manage = serviceSession.getService(SecurityManage.class);
		manage.updateLogin(oldpassword, newpassword, repassword);
		getController().prompt(request, response, PromptLevel.INFO,"密码修改成功");
		forwardView(request, response, getClass());
	}

}